﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Sites/EdgleyDesign/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Templates_MediaNumberedGallery_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript">
        var changeImage = function(index) {
            var listId = "<%=dlItems.ClientID%>";
            var list = $get(listId);
            var count = list.items;
            var linksId = "<%=pager.ClientID%>";
            for (i = 0; i < count; i++) {
                var item = $get(listId + "_item" + i);
                var linkId = linksId;
                if (i < 10) {
                    linkId += "_ctl0" + i + "_lnk";
                }
                else {
                    linkId += "_ctl" + i + "_lnk";
                }
                var link = $get(linkId);
                if (i == index) {
                    item.className = "galleryItem";
                    link.className = "redselected";
                }
                else {
                    item.className = "galleryItemHidden";
                    link.className = "portfolio-link";
                }
            }
            return false;
        }
    </script>
</asp:Content>
<asp:Content ID="contentMain" ContentPlaceHolderID="cphMain" runat="server">
    <div class="mediaNumbersTemplate">
        <div id="contentLeft">
            <acms:AcmsDataList ID="dlItems" runat="server">
                <ItemTemplate>
                    <acms:SubTemplateLoader ID="loader" TemplateFileName="Display" runat="server" />
                </ItemTemplate>
            </acms:AcmsDataList>
            <div class="media_numbers">
                <acms:SimpleRepeater ID="pager" runat="server">
                    <ItemTemplate>
                        <asp:HyperLink ID="lnk" NavigateUrl="#" onclick='<%#string.Format("javasctipt:return changeImage({0});", Container.ItemIndex) %>' Text='<%#Container.ItemIndex + 1 %>' CssClass='<%#Container.ItemIndex == 0 ? "redselected" : "portfolio-link"%>' runat="server" />
                    </ItemTemplate>
                </acms:SimpleRepeater>
            </div>
        </div>
        <div id="contentRight">
            <div id="title"><%#AcmsContext.CurrentPost.DisplayName %></div>
            <div id="contentRightInner">
                <acms:HtmlContentControlDisplay ID="html" ControlName="Text Area" runat="server" />
            </div>
        </div>
    </div>
</asp:Content>

